# -*- coding: utf-8 -*-
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from blog import app
import logging,time,os
filename ='\log\\'+ str(time.strftime('%Y-%m-%d', time.localtime(time.time()))) +'log.txt'
path = os.path.abspath(os.path.dirname(__file__)+ filename)
logging.basicConfig(handlers=[logging.FileHandler(path, encoding="utf-8")], level=logging.DEBUG,
                    format='%(asctime)s-%(levelname)s - %(message)s')  #导入日志模块
#logging.disable(logging.CRITICAL) #禁止日志输出
logging.debug('Start of program')  #标志程序开始

http_server = HTTPServer(WSGIContainer(app))
http_server.listen(5000)
IOLoop.instance().start()
logging.debug('End of program')

# -*- coding: utf-8 -*-
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from knowledge import create_app
from log.weblog import loger
import logging,os,time

loger.debug("开始!")
path ='log/'+str(time.strftime('%Y-%m-%d', time.localtime(time.time()))) +'log.txt'
logging.basicConfig(handlers=[logging.FileHandler(path, encoding="utf-8")], level=logging.DEBUG,
                    format='%(asctime)s-%(levelname)s - %(message)s')  #导入日志模块
#logging.disable(logging.CRITICAL) #禁止日志输出
logging.debug('Start of program')  #标志程序开始
app = create_app()
loger.debug(app)
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(5000)
IOLoop.instance().start()
